﻿<%@ Page Title="" Language="C#" MasterPageFile="~/master/default.master" AutoEventWireup="true" CodeFile="grid-view-sample.aspx.cs" Inherits="grid_view_sample" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" BackColor="#DEBA84" 
        BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
        CellSpacing="2" DataKeyNames="EmployeeId" DataSourceID="ObjectDataSource1">
        <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                ShowSelectButton="True" />
            <asp:BoundField DataField="EmployeeId" HeaderText="EmployeeId" 
                SortExpression="EmployeeId" />
            <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                SortExpression="FirstName" />
            <asp:BoundField DataField="LastName" HeaderText="LastName" 
                SortExpression="LastName" />
            <asp:BoundField DataField="HireDate" HeaderText="HireDate" 
                SortExpression="HireDate" />
            <asp:BoundField DataField="BirthDate" HeaderText="BirthDate" 
                SortExpression="BirthDate" />
            <asp:BoundField DataField="Address" HeaderText="Address" 
                SortExpression="Address" />
            <asp:BoundField DataField="Country" HeaderText="Country" 
                SortExpression="Country" />
            <asp:BoundField DataField="HomePhone" HeaderText="HomePhone" 
                SortExpression="HomePhone" />
            <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
            <asp:BoundField DataField="TitleOfCourtesy" HeaderText="TitleOfCourtesy" 
                SortExpression="TitleOfCourtesy" />
            <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
            <asp:BoundField DataField="Region" HeaderText="Region" 
                SortExpression="Region" />
            <asp:BoundField DataField="PostalCode" HeaderText="PostalCode" 
                SortExpression="PostalCode" />
            <asp:BoundField DataField="Extension" HeaderText="Extension" 
                SortExpression="Extension" />
            <asp:BoundField DataField="ReportsTo" HeaderText="ReportsTo" 
                SortExpression="ReportsTo" />
            <asp:BoundField DataField="PhotoPath" HeaderText="PhotoPath" 
                SortExpression="PhotoPath" />
        </Columns>
        <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
        <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
    </asp:GridView>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
        DataObjectTypeName="DaXDD.DataContainers.Employee" 
        DeleteMethod="DeleteEmployee" InsertMethod="CreateNewEmployee" 
        SelectMethod="GetAllEmployees" 
        TypeName="DaXDD.DataAccess.Model.ProxyDataAccess.EmployeeDAO" 
        UpdateMethod="UpdateEmployee">
        <DeleteParameters>
            <asp:Parameter Name="employeeId" Type="Int32" />
        </DeleteParameters>
    </asp:ObjectDataSource>

</asp:Content>

